<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Xml" %>
<html>
<script type="text/javascript" src="HiddenFrame.js"></script> 
    <script language="c#" runat="server">
        void Page_Load()
        {
            string xmlFile = @"C:\inetpub\wwwroot\BegAjax\Chapter4\hotel.xml";
            string HTML = "";
            DataSet ds1 = new DataSet();
            ds1.ReadXml(xmlFile);
            DataTableReader dt = ds1.CreateDataReader();
            int count = 0;
            while (dt.Read())
            {
                if ((dt["City"].ToString() == Request.Params["city"].ToString()) && (dt["Type"].ToString() == Request.Params["type"].ToString()))
                {
                    HTML += "<br><span>Hotel: " + dt[1].ToString() + "</span><br><span>Price: " + dt[3].ToString() + "</span><br>";
                    count++;
                }
             }     
            if (count ==0)
            {
                 HTML ="<br><span>No hotels available</span>";
            }
            Response.Write("<div id='displayinfo'>" + HTML + "</div>");
        }       
            </script> 
              
            <body onload="initialize()">
            </body>
            </html>